Skip to content

feat(events): pass preflight data to routes - #664

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
fix/preflight-result-context
Sep 6, 2026
Merged

feat(events): pass preflight data to routes#664
ScriptedAlchemy merged 2 commits into
mainfrom
fix/preflight-result-context

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Closes #661.

Summary

  • allow event preflight gates to return { outcome: 'execute', data } with strict-JSON data
  • expose the typed value as AgentEventRouteProps.preflight across standalone, shared-runtime, and Workbench production execution
  • preserve continue/deny short-circuit behavior and document the contract in English and Chinese

Verification

  • pnpm build && pnpm typecheck && pnpm lint && pnpm test:unit — passed
  • pnpm exec rstest --config rstest.unit.config.ts packages/agent-bundle/tests/event-preflight.test.ts packages/agent-bundle/tests/event-ipc.test.ts — 2 files, 36 tests passed
  • AGENT_BUNDLE_WORKBENCH_PREBUILT=1 AGENT_BUNDLE_PACKAGE_PREBUILT=1 pnpm exec rstest --config rstest.integration.config.ts packages/agent-bundle/tests/preflight-artifact-graph.test.ts packages/agent-bundle/tests/target-hook-contract.test.ts packages/agent-bundle/tests/route-invocation-dev-server.test.ts — 3 files, 25 tests passed
  • pnpm docs:site:build — passed

Deslop

Deslop: GPT-5.6 Sol, 1 edit. Corrected the stale result-count prose; no extra handler model, configuration, abstraction, or diagnostic was added.

Self-review

Reviewer: Claude Fable 5.1 Thinking High (change-risk-reviewer).

Initial findings and dispositions:

  • shared-runtime IPC data path lacked a direct round-trip assertion: extended the existing event IPC test and asserted the server receives a frozen strict-JSON snapshot
  • projection typing admitted execute objects: narrowed it to continue/deny outcomes
  • harness JSDoc omitted the optional preflight field: corrected it; kept public prose scoped to the requested hooks pages
  • changeset placeholder: replaced after PR creation

Rebase review found #643 had added Workbench production preflight execution after the branch base. Rebased onto current origin/main, wired execute data through prepareRouteInvocation and route-invocation-production, and extended the existing production parity test. Final Fable review found no actionable merge risks.

@changeset-bot

changeset-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 78b7b7c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/preflight-result-context branch from 931d311 to 78b7b7c Compare September 6, 2026 01:46
@ScriptedAlchemy
ScriptedAlchemy merged commit d94223a into main Sep 6, 2026
3 checks passed
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

main is red after this landed (CI run for 7e56517756, Verify (integration-2) on all three Node versions): packages/agent-bundle/tests/route-register-typegen.test.ts › "types every route-aware public surface from the generated route registration" — typecheck(root, 'assertions.ts') returns Type 'false' does not satisfy the constraint 'true'. Reproduces locally at origin/main (e4c5e26de3). The likely assertion is EventInput = Assert<Equal<keyof RegisteredRouteInput<'event:tool/after'>, 'canonical' | 'native'>> (test line ~176): this PR added preflight to AgentEventRouteProps, so the key set is now 'canonical' | 'native' | 'preflight'. The file is in the integration pool (rstest.integration-tests.ts), which the PR's gate did not include. Please fix or revert on main per AGENTS.md. (The other red in that run, route-invocation-dev-server.test.ts ×2, was #656's .compile- scratch dir and is fixed by #669.)

ScriptedAlchemy added a commit that referenced this pull request Sep 6, 2026
…#664 follow-up) (#670)

* test(typegen): register the optional preflight data on event-route inputs (#664)

* docs(testing): event-route input is { canonical, native, preflight? } (#664)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Event preflight: let the gate hand a value to the rendered route

1 participant